//
//  HYQWebViewController.m
//  HYQWebkit_Example
//
//  Created by zhuxingjian on 2018/8/20.
//  Copyright © 2018年 zxj1989. All rights reserved.
//

#import "HYQWebViewController.h"

@interface HYQWebViewController ()

@end

@implementation HYQWebViewController

- (void)dealloc
{
    NSLog(@"HYQWebViewController销毁");
}

- (HYQBaseBridgeManager *)bridgeManager
{
    if (!_bridgeManager) {
        _bridgeManager = [[HYQBaseBridgeManager alloc] init];
        _bridgeManager.contentViewController = self;
    }
    return _bridgeManager;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    _webView = [[HYQWebView alloc] initWithBridgeManager:self.bridgeManager];
    [_webView loadWebViewWithURLString:self.url];
    _bridgeManager.webView = _webView;
    [self.view addSubview:_webView];
}

- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    _webView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds));
}

- (NSString *)viewId
{
    if (!_viewId) {
        return NSStringFromClass([self class]);
    }
    return _viewId;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
